﻿using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace OpenCompiler.Scanning.Tests.Specs_for_scanner
{
	[TestClass]
	public class When_scanning_for_coalesce
	{
		[TestMethod]
		public void Expression_begin_and_separator_is_tokenized()
		{
			const string sourceCode = "bool isTrue=(someVar==true)?true:false";
			var tokens = TokenTestHelper.TokenizeWithoutEOF(sourceCode);
			Assert.AreEqual(12,tokens.Count);
			Assert.AreEqual(Coalesce.Question, tokens[8].ActualToken);
			Assert.AreEqual(Coalesce.Colon, tokens[10].ActualToken);
		}
	}
}